package org.example.protocol.structs;

import lombok.Data;
import java.util.Map;
import cn.hutool.core.map.MapUtil;
import org.artifact.core.lang.DTO;
@Data
/**
 * 玩家简单信息
 */
public class PlayerInfoDTO implements DTO{
	/** 用户ID */
	private long uid;
	/** 玩家ID */
	private long pid;
	/** 昵称 */
	private java.lang.String name;
	/** 等级 */
	private int lvl;
	/** 经验 */
	private int exp;
	/** 头像 */
	private int icon;
	/** 类型 */
	private int type;

	public Map<Object, Object> toMap(Map<Object, Object> map){
		map.put(115792,this.uid);
		map.put(110987,this.pid);
		map.put(3373707,this.name);
		map.put(107554,this.lvl);
		map.put(100893,this.exp);
		map.put(3226745,this.icon);
		map.put(3575610,this.type);
	    return map;
	}

	public PlayerInfoDTO forMap(Map<Object, Object> map){
        this.uid = MapUtil.getLong(map ,115792);
        this.pid = MapUtil.getLong(map ,110987);
        this.name = MapUtil.getStr(map ,3373707);
        this.lvl = MapUtil.getInt(map ,107554);
        this.exp = MapUtil.getInt(map ,100893);
        this.icon = MapUtil.getInt(map ,3226745);
        this.type = MapUtil.getInt(map ,3575610);
        return this;
    }
}